package com.rcc.mongo.service;

import com.rcc.mongo.entity.UserMongo;
import com.rcc.mongo.repository.UserMongoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by rcc on 2017/6/24.
 */
@Service
public class MongoService {
    @Autowired
    private UserMongoRepository userMongoRepository;

    public UserMongo findUserByName(String name){
        UserMongo userMongo=null;
        try {
            userMongo=userMongoRepository.findByName(name);
        }catch (Exception e){
            System.out.println(e);
        }
        return userMongo;
    }
}
